package com.jaswine.controller;

import com.jaswine.bean.dto.DTO;
import com.jaswine.bean.dto.RtnDTO;
import com.jaswine.bean.po.InfoPO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.concurrent.ConcurrentLinkedQueue;

/**
 * 第三方接口
 *
 * @author Jaswine
 */
@CrossOrigin
@RestController("/api/v1/info")
@Slf4j
public class ClientController {


	public static ConcurrentLinkedQueue<InfoPO> infoPOQueue = new ConcurrentLinkedQueue<InfoPO>();


	@PostMapping
	public DTO getInfo(@RequestBody InfoPO infoPO){
		log.info(infoPO.toString());
		infoPOQueue.add(infoPO);

		RtnDTO<String> dto = new RtnDTO<String>();
		dto.setCode(200);
		dto.setMsg("SUCCESS");
		return dto;

	}

}
